/*
 * Copyright (c) 2008, Xiong Yingfei, the University of Tokyo
 * All rights reserved.
 */
package ac.jp.u_tokyo.SyncLib.language.factories;

import ac.jp.u_tokyo.SyncLib.EqualSync;
import ac.jp.u_tokyo.SyncLib.SetMembers;
import ac.jp.u_tokyo.SyncLib.Sync;
import ac.jp.u_tokyo.SyncLib.SyncFactory;
import ac.jp.u_tokyo.SyncLib.SetMembers.MembersTester;
import ac.jp.u_tokyo.SyncLib.SetMembers.NoDefaultValue;

public class NotEqualFactory implements SyncFactory
{
	Object _value;
	
	private Object _defaultValue = new NoDefaultValue();

	public void setDefaultValue(Object defaultValue)
	{
		_defaultValue = defaultValue;
	}


	public void setValue(Object value)
	{
		_value = value;
	}


	public Sync create()
	{
		if (_defaultValue instanceof NoDefaultValue)
			return new SetMembers(new NotEqualTester(_value), _defaultValue);
		return new SetMembers(new NotEqualTester(_value), new Object[] {_defaultValue});
	}

	
}
